﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Public.Common;
using Public;

public partial class article : System.Web.UI.Page
{
    public Forum.Entities.forum_muluinfo model = null;
    public int mid = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ShowData();
        }
    }
    protected void ShowData()
    {
        int count = MRequest.GetQueryInt("count", 0);
        int page = MRequest.GetQueryInt("page", 1);
        mid = MRequest.GetQueryInt("id", 0);
        if (mid != null)
        {
            model = WebBase.CacheRepository.forum_mulu.GetByMuLuId(mid);
            string where = " Body_MuLuID=" + mid;

            this.Repeater1.DataSource = WebBase.CacheRepository.forum_body.GetPaged(where, " body_fangwen desc ", 0, 10);
            this.Repeater1.DataBind();

            where = " Body_MuLuID=" + mid;
            count = count == 0 ? WebBase.Repository.forum_body.GetCount(where) : count;

            this.Repeater2.DataSource = WebBase.CacheRepository.forum_body.GetPaged(where, " body_id desc ", page == 0 ? 0 : page - 1, 20);
            this.Repeater2.DataBind();

            //hb.pagelist.info_pagelist page_ = new hb.pagelist.info_pagelist(count, page, 2, 20, "article", null);
            //page_.StrType = "aspx";
            AspNetPage pp = new AspNetPage(count, page, 2, 20);
            pp.URLTYPE = AspNetPageInfo.URLType.Aspx;
            this.pagelisthtml.InnerHtml = pp.GetPages();
        }
    }
}